import { createRouter, createWebHashHistory } from 'vue-router'
import user from './user/user'   // 用户
import discover from './discover/discover.js' //发现音乐
import MyMuci from '../components/myMusic/MyMusic.vue' //我的音乐
import Follow from '../components/follow/Follow.vue'  //关注
import Mall from '../components/mall/Mall.vue' //商城
import Musician from '../components/musician/Musician.vue' //我的音乐
import Download from '../components/download/Download.vue' //下载



const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            redirect: '/discover'
        },
        ...discover,
        {
            path: '/myMusic',
            component: MyMuci,
            name: 'myMusic'
        },
        {
            path: '/follow',
            component: Follow,
            name: 'follow'
        },
        {
            path: '/mall',
            component: Mall,
            name: 'mall'
        },
        {
            path: '/musician',
            component: Musician,
            name: 'musician'
        },
        {
            path: '/download',
            component: Download,
            name: 'download'
        },
        ...user,
        {
            path: '/search',
            component: () => import('../components/search/Sear.vue'),
            name: 'search'
        }

    ]
})

export default router;